<template>
	<transition :mode="mode" :name="transitionName">
		<slot></slot>
	</transition>
</template>

<script>
	export default {
		name: "enter-leave",
		data() {
			return {
				transitionName: 'move'
			}
		},
		props: {
			mode: {
				type: String
			}
		},
		watch: {
			'$router.isBack'(nextValue) {
				if (nextValue) {
					this.transitionName = 'outMove'
				} else {
					this.transitionName = 'move'
				}
			}
		}
	}
</script>
